package br.com.projeto;

import java.io.IOException;

import org.json.JSONException;
import org.json.JSONObject;

import br.com.projeto.json.HttpClientJson;
import br.com.projeto.json.JsonConverter;
import br.com.projeto.jsoup.HttpClientJsoup;
import br.com.projeto.vo.Loteria;

public class RestClient {

	public static Loteria getResultsJson () throws JSONException, IllegalStateException, IOException{
		return JsonConverter.converterJogo(new JSONObject(HttpClientJson.httpGet()));
	}

	public static Loteria getResultsJsoup() throws IOException  {
		return new Loteria(HttpClientJsoup.httpGetLast());
	}
	
	public static Loteria getFindResultsJsoup(String number) throws IOException  {
		return new Loteria(HttpClientJsoup.httpGetByNumber(number));
	}
}
